bool centerWindow(HWND hWnd)
{
	RECT rc;
	GetWindowRect(hWnd, &rc);

	int x = (GetSystemMetrics(SM_CXSCREEN) - (rc.right - rc.left)) / 2;
	int y = (GetSystemMetrics(SM_CYSCREEN) - (rc.bottom - rc.top)) / 2;

	return SetWindowPos(hWnd, 0, x, y, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
}
